##############################################################
#Figure D3: Distribution of Risk Aversion by Age in HRS
##############################################################

data <- read.dta13("U:/temp/hrs_toplot.dta")
data$risk <- as.factor(data$risk)

ggplot(data, aes(age, fill=risk)) + 
  geom_histogram(binwidth = 1, alpha=.3, position = "identity") + 
  scale_fill_manual(values=c("black", "grey40", "grey60", "darkgoldenrod4", "darkgoldenrod1", "goldenrod1"),
                    labels=c("V Taker", "Taker", "Neutral-Tk", "Neutral-Av", "Averse", "V Averse"),
                    name="Risk Aversion") + 
  ylab("Count") + xlab("Age") 
ggsave("U:/export/figd3.pdf")
